package dto

import (
	"github.com/gogf/gf/v2/os/gtime"
)

// OperationsCenterDay 智链影创-运营中心-每日业绩统计表
type OperationsCenterDay struct {
	Id                  int         `json:"id"                  orm:"id,primaryKey,autoIncrement" comment:"主键"`
	UpdateTime          *gtime.Time `json:"updateTime"          orm:"update_time" comment:"更新时间（自动更新）"`
	CreateTime          *gtime.Time `json:"createTime"          orm:"create_time" comment:"创建时间"`
	Name                string      `json:"name"          orm:"name" comment:"运行中心名称" binding:"required"` // 非NULL约束，加binding校验（可选）
	YesterdayOrderPrice float64     `json:"yesterdayOrderPrice" orm:"yesterday_order_price" comment:"昨日销售业绩" binding:"required"`
	ReleaseParameter    float64     `json:"release_parameter"   orm:"release_parameter" comment:"今日学习释放比例" binding:"required"`
	Remark              string      `json:"remark"              orm:"remark" comment:"备注说明" binding:"required"`
	Day                 *gtime.Time `json:"day"                 orm:"day" comment:"统计日期"`
}

// OperationsCenter 智链影创-运营中心
type OperationsCenter struct {
	Id               int         `json:"id"                  orm:"id,primaryKey,autoIncrement" comment:"主键"`
	UpdateTime       *gtime.Time `json:"updateTime"          orm:"update_time" comment:"更新时间（自动更新）"`
	CreateTime       *gtime.Time `json:"createTime"          orm:"create_time" comment:"创建时间"`
	Name             string      `json:"name"          orm:"name" comment:"运行中心名称" binding:"required"`        // 非NULL约束，加binding校验（可选）
	UserName         string      `json:"userName"          orm:"user_name" comment:"负责人姓名" binding:"required"` // 非NULL约束，加binding校验（可选）
	UserId           int         `json:"userId"          orm:"user_id" comment:"负责人id" binding:"required"`       // 非NULL约束，加binding校验（可选）
	ReleaseParameter float64     `json:"releaseParameter"   orm:"release_parameter" comment:"释放参数(体系有入单是1，体系没有入单是0.5)" binding:"required"`
}

// UserInfo 用户信息表
type UserInfo struct {
	Id                          int         `json:"id"                          orm:"id,primaryKey,autoIncrement" comment:"主键"`
	UserNum                     string      `json:"userNum"                     orm:"user_num,unique" comment:"用户编号(推荐码)"`
	Username                    string      `json:"username"                    orm:"username,primaryKey,unique" comment:"用户名"`
	Password                    string      `json:"password"                    orm:"password" comment:"密码"`
	VxNum                       string      `json:"vxNum"                       orm:"vx_num" comment:"微信号"`
	UserType                    int         `json:"userType"                   orm:"user_type" comment:"用户类型(1.普通会员  2.有效会员  3.店长  4.销售股东  5.超级管理员)"`
	RealName                    string      `json:"realName"                   orm:"real_name" comment:"用户姓名"`
	Phone                       string      `json:"phone"                       orm:"phone" comment:"电话"`
	IdentityNumber              string      `json:"identityNumber"              orm:"identity_number" comment:"身份证号"`
	UserBankName                string      `json:"userBankName"                orm:"user_bank_name" comment:"开户姓名"`
	BankNum                     string      `json:"bankNum"                     orm:"bank_num" comment:"银行卡号"`
	BankName                    string      `json:"bankName"                    orm:"bank_name" comment:"开户行"`
	BankBranchName              string      `json:"bankBranchName"              orm:"bank_branch_name" comment:"银行支行名称"`
	BankProvince                string      `json:"bankProvince"                orm:"bank_province" comment:"开户省份"`
	BankCity                    string      `json:"bankCity"                    orm:"bank_city" comment:"开户市"`
	IsShared                    int         `json:"isShared"                    orm:"is_shared" comment:"是否可分享(1.可以分享  2.不能分享)"`
	Shared                      int         `json:"shared"                      orm:"shared" comment:"分享人(上级id)"`
	DirectSalesUserCount        int         `json:"directSalesUserCount"        orm:"direct_sales_user_count" comment:"直接销售用户数量"`
	GreenPointsAmount           float64     `json:"greenPointsAmount"          orm:"green_points_amount" comment:"绿色积分数量"`
	GreenPointsUpdateTime       *gtime.Time `json:"greenPointsUpdateTime"       orm:"green_points_update_time" comment:"绿色积分更新时间"`
	ConsumptionPointsAmount     float64     `json:"consumptionPointsAmount"    orm:"consumption_points_amount" comment:"消费积分数量"`
	ConsumptionPointsUpdateTime *gtime.Time `json:"consumptionPointsUpdateTime" orm:"consumption_points_update_time" comment:"消费积分更新时间"`
	ExchangeCoupon              int         `json:"exchangeCoupon"              orm:"exchange_coupon" comment:"兑换券数量"`
	CopyrightCount              int         `json:"copyrightCount"              orm:"copyright_count" comment:"版权数量"`
	TotalAmountConsumed         float64     `json:"totalAmountConsumed"        orm:"total_amount_consumed" comment:"消费总金额"`
	RealNameStatus              int         `json:"realNameStatus"              orm:"real_name_status" comment:"实名审核状态(1.待提交  2.待审核  3.审核通过  4.审核不通过)"`
	RealNameStatusUpdateTime    *gtime.Time `json:"realNameStatusUpdateTime"    orm:"real_name_status_update_time" comment:"实名状态更改时间"`
	RealNameFailRemark          string      `json:"realNameFailRemark"          orm:"real_name_fail_remark" comment:"实名审核失败原因"`
	BankCardStatus              int         `json:"bankCardStatus"              orm:"bank_card_status" comment:"银行卡审核状态(1.待提交  2.待审核  3.审核通过  4.审核不通过)"`
	BankCardStatusUpdateTime    *gtime.Time `json:"bankCardStatusUpdateTime"    orm:"bank_card_status_update_time" comment:"银行卡状态更改时间"`
	BankCardFailRemark          string      `json:"bankCardFailRemark"          orm:"bank_card_fail_remark" comment:"银行卡审核失败原因"`
	IdentityCardFrontImgId      int         `json:"identityCardFrontImgId"      orm:"identity_card_front_img_id" comment:"身份证正面照片id"`
	IdentityCardReverseImgId    int         `json:"identityCardReverseImgId"    orm:"identity_card_reverse_img_id" comment:"身份证反面照片id"`
	BankCardImgId               int         `json:"bankCardImgId"               orm:"bank_card_img_id" comment:"银行卡照片id"`
	CreateTime                  *gtime.Time `json:"createTime"                  orm:"create_time" comment:"注册时间"`
	UpdateTime                  *gtime.Time `json:"updateTime"                  orm:"update_time" comment:"修改时间"`
	IsDeleted                   int         `json:"isDeleted"                   orm:"is_deleted" comment:"是否删除"`
}

// JxyUserSum 棘祥源平移智链影创未入单用户提现金额表
type JxyUserSum struct {
	Id                      int     `json:"id"           orm:"id,primaryKey,autoIncrement" comment:"主键"`
	ZlycIds                 string  `json:"zlyc_ids"           orm:"zlyc_ids" comment:"文创id列表"`
	UserBankName            string  `json:"user_bank_name"      orm:"user_bank_name" comment:"提现姓名" binding:"required"`                  // 非空约束
	GreenPointsAmount       float64 `json:"green_points_amount"   orm:"green_points_amount" comment:"绿色积分" binding:"required"`           // 非空约束
	ConsumptionPointsAmount float64 `json:"consumption_points_amount" orm:"consumption_points_amount" comment:"消费积分" binding:"required"` // 非空约束
	WithdrawTotal           float64 `json:"withdrawal_amount" orm:"withdrawal_amount" comment:"提现金额" binding:"required"`                 // 非空约束
}

// WithdrawalApproval 提现审批表
type WithdrawalApproval struct {
	Id                     int         `json:"id"                     orm:"id,primaryKey,autoIncrement" comment:"主键"`
	UserId                 string      `json:"userId"                 orm:"user_id" comment:"申请人id"`
	WithdrawalAmount       float64     `json:"withdrawalAmount"       orm:"withdrawal_amount" comment:"申请提现数目"`
	ApplicationTime        *gtime.Time `json:"applicationTime"        orm:"application_time" comment:"申请时间（自动填充当前时间）"`
	Status                 int         `json:"status"                 orm:"status" comment:"审批状态 1.待审核  2.通过  3.不通过"`
	ApprovalTime           *gtime.Time `json:"approvalTime"           orm:"approval_time" comment:"审批时间"`
	RemittanceAmount       float64     `json:"remittanceAmount"       orm:"remittance_amount" comment:"打款金额"`
	BeforeWithdrawalAmount float64     `json:"beforeWithdrawalAmount" orm:"before_withdrawal_amount" comment:"提现前消费积分数目"`
	AfterWithdrawalAmount  float64     `json:"afterWithdrawalAmount"  orm:"after_withdrawal_amount" comment:"提现后消费积分数目"`
	UserBankName           string      `json:"userBankName"           orm:"user_bank_name" comment:"开户姓名"`
	BankName               string      `json:"bankName"               orm:"bank_name" comment:"开户行"`
	BankNum                string      `json:"bankNum"                orm:"bank_num" comment:"卡号"`
	Remark                 string      `json:"remark"                 orm:"remark" comment:"审核意见"`
}

/*上面是数据表结构,下面是需要自定义使用的结构体*/

// UserOperationsJoin 多表JOIN结果结构体（user_info LEFT JOIN operations_center）
type UserOperationsJoin struct {
	//  user_info 表字段（别名 u）
	Id       int `json:"id"             orm:"u.id" comment:"用户ID"`
	UserType int `json:"userType"                   orm:"user_type" comment:"用户类型(1.普通会员  2.有效会员  3.店长  4.销售股东  5.超级管理员)"`
	//  operations_center 表字段（别名 c）
	Name string `json:"name"            orm:"c.name" comment:"运营中心名称"`
}

// OperationsCenterDayInsert 插入结构体
type OperationsCenterDayInsert struct {
	Name                string      `json:"name"          orm:"name" comment:"运行中心名称" binding:"required"` // 非NULL约束，加binding校验（可选）
	YesterdayOrderPrice float64     `json:"yesterdayOrderPrice" orm:"yesterday_order_price" comment:"昨日销售业绩" binding:"required"`
	ReleaseParameter    float64     `json:"release_parameter"   orm:"release_parameter" comment:"今日学习释放比例" binding:"required"`
	Remark              string      `json:"remark"              orm:"remark" comment:"备注说明" binding:"required"`
	Day                 *gtime.Time `json:"day"                 orm:"day" comment:"统计日期"`
}
